package jike.demo08;

import java.io.FileWriter;
import java.io.IOException;
import java.util.logging.Level;

/**
 * @param
 * @author oyz
 * @version 1.0.4
 * @description: 输出信息到文件中
 * @date 2022/10/27 21:53
 */
public class FileLoger extends Logger {

    private FileWriter writer;


    public FileLoger(String name, boolean enabled, Level level,String filePath) throws IOException {
        super(name, enabled, level);
        writer = new FileWriter(filePath);
    }

    @Override
    protected void doLog(Level level, String name) {
        try {
            writer.write(name);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }

    public void test(){
        System.out.println("存在方法的实现。。。");
    }
}
